package company.zuiyou;

import java.util.HashMap;
import java.util.Map;

public class Z4 {
    // 1 3 3 3 5 5 5
    public int getCountOne(int[] nums) {
        Map<Integer, Integer> dict = new HashMap<>();
        for (int num : nums) {
            dict.put(num, dict.getOrDefault(num, 0) + 1);
        }
        for (Map.Entry<Integer, Integer> e : dict.entrySet()) {
            if (e.getValue() == 1)
                return e.getKey();
        }
        return -1;
    }
}
